{template 'admin','header'}
{template 'admin','content_menu'}
<form name="searchform" action="{$self_url}" method="get">
    <input type="hidden" name="catid" value="{$catid}">
    <input type="hidden" name="action" value="audit">
    <input type="hidden" name="processid" value="{$processid}">
    <input type="hidden" name="module" value="{$module_name}">
    <table cellpadding="0" cellspacing="1" class="table_list">
        <caption>{$workflow[$processid]['name']}</caption>
        <tr>
            <td class="align_l">
                <strong>状态：</strong>
                <label><input type="radio" name="status" value="" {if $status==''}checked{/if}>全部</label>
                {loop $prestatus $s}
                {if isset($status_list[$s])}<label><input type="radio" name="status" value="{$s}" {if $s==$status}checked{/if}>{$status_list[$s]}</label>{/if}
                {/loop}
            </td>
        </tr>
    </table>
</form>
<script>
    $('input:radio[name=status]').change(function(){
        document.searchform.submit();
    });
</script>
<form method="post" name="myform" action="{$self_url}?action=status&module={$module_name}" onsubmit="return r_submit(this);">
    <input type="hidden" name="catid" value="{$catid}">
    <input type="hidden" name="val">
    <table cellpadding="0" cellspacing="1" class="table_list">
        <caption>审核列表</caption>
        <tr>
            <th width="30">选中</th>
            <th>标题</th>
            <th width="100">状态</th>
            <th width="100">发布人</th>
            <th width="100">发布时间</th>
            <th width="130">管理操作</th>
        </tr>
        {loop $data $r}
        <tr>
            <td class="align_c"><input type="checkbox" size="5" name="selected[]" value="{$r['id']}"></td>
            <td class="align_l">{$r['title']}</td>
            <td class="align_c">{$status_list[$r['status']]}</td>
            <td class="align_c">{$r['username']}</td>
            <td class="align_c">{date('Y-m-d',$r['addtime'])}</td>
            <td class="align_c">
                {if $c->check_perms($catid, 'CON005')}
                <a href="{$self_url}?action=edit&catid={$r['catid']}&id={$r['id']}&module={$module_name}">修改</a>
                {/if}
            </td>
        </tr>
        {/loop}
    </table>
    <div class="button_box">
        <a href="javascript:void(0);" onclick="$('form[name=myform]').find('input:checkbox').attr('checked','true')">全选</a>/<a href="javascript:void(0);" onclick="$('form[name=myform]').find('input:checkbox').attr('checked','')">取消</a>
        <input class="button_style" name="audit" type="button" value=" {$workflow[$processid]['passname']} " onclick="audit_content({$workflow[$processid]['passstatus']})">
        <input class="button_style" name="audit" type="button" value=" {$workflow[$processid]['rejectname']} " onclick="audit_content({$workflow[$processid]['rejectstatus']})">
	    {if $c->check_perms($catid, 'CON006')}
		<input name="add" type="button" value=" 批量删除 " onclick="if(confirm('确定要删除所选择的内容吗？')){change_opt('myform','{$self_url}?action=delete_all&module={$module_name}');}">
	    {/if}
	    {if $module_name !='category'}<input type="button" value="返回上一级" onclick="self.location='{$back}'">{/if}
    </div>
    <div id="pages">{$pages}</div>
</form>
<script>
    function audit_content(val)
    {
    	change_opt('myform','{$self_url}?action=status&module={$module_name}');
        $('input:hidden[name=val]').val(val);
        r_submit(document.myform);
    }
</script>
{template 'admin','footer'}